<template>
	<view class="Menu">
		<!-- 导航条 :style="{ height: $wanlshop.wanlsys().height + 'px' }"-->
		<view class="cu-custom">
			<view class="cu-bar fixed" style="background: #06224b; color: #fff;"
				:style="{height: $wanlshop.wanlsys().height + 'px',paddingTop: $wanlshop.wanlsys().top + 'px',}">
				<view class="action">
					<text class="wlIcon-fanhui1" style="margin-left: 0" @tap="$wanlshop.back(1)"></text>
				</view>
				<view class="content" :style="{ top: $wanlshop.wanlsys().top + 'px' }">
					理财专区
				</view>
				<view class="action">
					<!-- <text class="wlIcon-gengduo" @tap="showModal('share')"></text> -->
				</view>
			</view>
		</view>
		<view style="position: fixed;height: auto;  width: auto; top: 0; left: 0; bottom: 0; right: 0;"
			:style="{top: $wanlshop.wanlsys().height + 'px',}">

			<view class="indexList" v-for="(item,index) in list" @click="gocomit(item)">
				<view class="listL">
					<image :src="$wanlshop.oss(item.image)"></image>
				</view>
				<view class="listR">
					<h3>{{item.name}}</h3>
					<!-- <p>{{item.text}}</p> -->
				</view>
			</view>
			<view class="indexList" v-for="(item,index) in list1" @click="gocomit1(item)">
				<view class="listL">
					<image :src="$wanlshop.oss(item.image)"></image>
				</view>
				<view class="listR">
					<h3>{{item.name}}</h3>
					<!-- <p>{{item.text}}</p> -->
				</view>
			</view>
		</view>
		<u-popup :show="show" mode="bottom" @close="close" :closeable='false' :closeOnClickOverlay='true'>
			<view class="cont">
				<view class="title">投资协议</view>

				<scroll-view scroll-y="true" class="scroll-y" @scrolltolower="scrolltolower()">
					<view class="xy" v-html="tz_content">
					</view>
				</scroll-view>
				<view class="btn-list" v-if="is_sign">
					<view v-if="isBottom" class="btn-complete" @click="commit">{{$t('wanlAgree-tongyianniu')}}</view>
					<view v-if="!isBottom" class="btn-reset">{{$t('wanlAgree-tongyianniu')}}</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				show: false,
				is_sign: true,
				isBottom: false,
				list: [],
				list1: [],
				id: '',
				tz_content: '',
				type: ''
			};
		},
		onShow() {
			this.init()
			this.show = false
		},
		methods: {
			init() {
				uni.request({
					url: "/financing/financingList",
					method: 'POST',
					success: (res) => {
						if (res.res.code == 1) {
							this.list = res.res.data
						}
					},
				});
				uni.request({
					url: "/financingcdn/financingList",
					method: 'POST',
					success: (res) => {
						if (res.res.code == 1) {
							this.list1 = res.res.data
						}
					},
				});
			},
			gocomit(val) {
				this.tz_content = val.tz_content
				this.id = val.id
				this.show = true
				this.isBottom = true
				this.type = '1'
			},
			gocomit1(val) {
				this.tz_content = val.tz_content
				this.id = val.id
				this.show = true
				this.isBottom = true
				this.type = '2'
			},
			commit() {
				this.show = false
				if (this.type == '1') {
					this.$wanlshop.to("/pages/manage/ylBaos?id=" + this.id);
				} else {
					this.$wanlshop.to("/pages/manage/cdn?id=" + this.id);
				}
			},
			scrolltolower() {
				this.isBottom = true
			},
			close() {
				this.show = false
			}
		}
	};
</script>

<style lang="scss">
	page {
		background: #06224b;
	}

	.Menu {
		.indexList {
			margin: 24rpx 24rpx 16rpx 24rpx;
			padding: 30rpx 14rpx;
			color: #fff;
			clip-path: polygon(15px 0px,
					calc(100% - 15px) 0,
					100% 15px,
					100% calc(100% - 15px),
					calc(100% - 15px) 100%,
					15px 100%,
					0 calc(100% - 15px),
					0 15px);
			background:
				linear-gradient(-45deg, #016C91 10.2px, rgba(0, 0, 0, 0) 0) bottom right,
				linear-gradient(45deg, #016C91 10.2px, rgba(0, 0, 0, 0) 0) bottom left,
				linear-gradient(135deg, #016C91 10.2px, rgba(0, 0, 0, 0) 0) top left,
				linear-gradient(-135deg, #016C91 10.2px, rgba(0, 0, 0, 0) 0) top right;
			border: 2rpx solid #016C91;
			box-shadow: inset 0px 0px 40px 0px #016C91;
			display: flex;
			align-items: center;

			.listL {
				width: 100rpx;
				height: 100rpx;
				margin-right: 20rpx;

				uni-image {
					width: 100%;
					height: 100%;
				}
			}

			.listR {
				color: #82F0FF;

				h3 {
					font-weight: 500;
					font-size: 30rpx;
					margin-bottom: 20rpx;
				}

				p {
					font-weight: 400;
					font-size: 24rpx;
				}
			}
		}

		.cont {
			background: #00132B;

			.title {
				text-align: center;
				font-size: 28rpx;
				color: #51E7FC;
				padding: 40rpx;
			}

			.xy {
				padding: 0 24rpx;
				font-size: 28rpx;
				color: #FFFFFF;
				line-height: 48rpx;
				text-align: justified;

			}

			.scroll-y {
				height: 40vh;
			}

			.btn-list {
				width: 100%;
				height: 150rpx;

				display: flex;
				align-items: center;
				justify-content: space-around;

				.btn-reset {
					width: 100%;
					margin: 20rpx 20rpx 0;
					height: 96rpx;
					background: #f4f4f4;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					font-size: 30rpx;
					color: #3E3E3E;
					display: flex;
					align-items: center;
					justify-content: center;
				}

				.btn-complete {
					width: 100%;
					margin: 20rpx 20rpx 0;
					height: 96rpx;
					border-radius: 16rpx 16rpx 16rpx 16rpx;
					font-size: 30rpx;
					color: #00132B;
					background-color: #51E7FC;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
</style>